<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8s">
<title>Insert title here</title>
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/default/easyui.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/icon.css"/>">
	
	<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>

</head>
<body>
	<style type="text/css">
	#l li{
			float:left;
			margin:20px;
			list-style:none;
		}
		#bccw{
			width:920px;
			border-right:6px solid rgb(230,240,255);
			float:left;
		}
		#bcxx{
		    position:fixed;
			right:43px;
			top:160px;
			width:300px;
			border:1px solid gray;
		}
	</style>
	<script type="text/javascript">
	
	
	//获取在这个区域内的单击事件
		$("#l>li").click(function (e) {
	            //获取单击事件的属性 
	            var v = $(e.target).attr('value');
	           
		    	$.getJSON("selectcwxx", {"cw": v}, function(data){
				$("#form-bcxx").form("load", data);});
				});
		$("#ckcf").linkbutton({onClick:function(){
				var brno= document.getElementById("brno").value;
				//alert(brno);
				$("#brcf").window("open");
				$.getJSON("selectyp", {"brNo": brno}, function(data){
					//alert(data.yizhu);
					document.getElementById("yizhu").value = data.yizhu;
					for(var i=0;i<data.yaopin.length;i++){
						var input =  $("<input>");;
						input.val(data.yaopin[i]);
						input.appendTo($(yaopin));
					}
					});
				 	$(yaopin).empty();
				 	$(yizhu).val("");  
				
			}});

		$("#ghcw").linkbutton({onClick:function(){
			
				$("#his_ghcw").window("open");
				var bqNo = document.getElementById("bqno").value;
				
				var url = 'cw?bqNo='+bqNo;
				$("#tb-ghcw").datagrid({url: url});
			
		}});
		
		//确认更换病床
		$("#ghcwqr").linkbutton({onClick:function(){
			var rows = $("#tb-ghcw").datagrid("getSelections");
			
			if(rows.length == 1){
				
				var brno = document.getElementById("brno").value;
				
				var cwno = rows[0].cwNo;
				
				$.getJSON("ghcw", {"brno": brno,"cwno":cwno}, function(data){
					
					$.messager.alert("提示", data.reason);							
				});
				//关闭窗口
				$("#his_ghcw").window("close");
							
			}
			else{
				$.messager.alert("提示", "只能选择一条记录，您目前选择了" + rowcw.length + "条!");
			}}});
	</script>
	<div id="bccw">
	<ul id="l" >
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="1"><p value="1">1号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="2"><p  value="2">2号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="3"><p  value="3">3号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="4"><p value="4">4号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="5"><p value="5">5号床 </p></div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="6"><p value="6">6号床 </p></div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="7"><p  value="7">7号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="8"><p value="8">8号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="9"><p value="9">9号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="10"><p value="10">9号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="11"><p value="11">11号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="12"><p value="12">12号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="13"><p value="13">13号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="14"><p value="14">14号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="15"><p value="15">15号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="16"><p value="16">16号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="17"><p value="17">17号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="18"><p value="18">18号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="19"><p value="19">19号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="20"><p value="20">20号床 </p></div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="21"><p value="21">21号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="22"><p value="22">22号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="23"><p value="23">23号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="24"><p value="24">24号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="25"><p value="25">25号床 </p></div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="26"><p value="26">26号床 </p></div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="27"><p value="27">27号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="28"><p value="28">28号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="29"><p value="29">29号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="30"><p value="30">30号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="31"><p value="31">31号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="32"><p value="32">32号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="33"><p value="33">33号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="34"><p value="34">34号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="35"><p value="35">35号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="36"><p value="36">36号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="37"><p value="37">37号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="38"><p value="38">38号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="39"><p value="39">39号床</p> </div></li>
		<li><div   class="easyui-linkbutton" ><img src="img/bc.png" value="40"><p value="40">40号床 </p></div></li>
		
	</ul>
	</div>
	<div id="bcxx">
		<h3 align="center">病床病人信息</h3>
		<form id="form-bcxx" action=""  method="post" style="border:1px solid gray" >
					<div class="item"><input name="brNo"  id="brno"   readonly="readonly"  class="easyui-textbox" data-options="label: '病人编号：', width: 200"></div>
					<div class="item"><input name="brName" readonly="readonly"  class="easyui-textbox" data-options="label: '病人姓名：', width: 200"></div>
					<div class="item"><input name="brAge" readonly="readonly"  class="easyui-textbox" data-options="label: '年龄：', width: 200"></div>
					<div class="item"><input name="brSex" readonly="readonly" class="easyui-textbox" data-options="label: '性别：', width: 200"></div>
					<div class="item"><input name="brTel" readonly="readonly" class="easyui-textbox" data-options="label: '联系方式：', width: 200"></div>
					<div class="item"><input name="brAddress" readonly="readonly" class="easyui-textbox" data-options="label: '家庭住址：', width: 230"></div>
					<div class="item"><input name="brIdnumber" readonly="readonly" class="easyui-textbox" data-options="label: '身份证号：', width: 230"></div>
					<div class="item"><input name="ylkNo" readonly="readonly" class="easyui-textbox" data-options="label: '医疗卡号', width: 200"></div>
					<div class="item"><input name="ksmc" readonly="readonly" class="easyui-textbox " data-options="label: '科室：', width: 200"></div>
					<div class="item"><input name="bqNo" id="bqno" readonly="readonly" class="easyui-textbox " data-options="label: '科室号：', width: 200"></div>
					<div class="item"><input name="brSituation" readonly="readonly" class="easyui-textbox" data-options="label: '病人情况：', width: 200"></div>
					<div class="item"><input name="cwNo"  readonly="readonly" class="easyui-textbox" data-options="label: '床位', width: 200"></div>
					<div class="item"><input name="zyysNo" readonly="readonly" class="easyui-textbox" data-options="label: '住院医生', width: 200"></div>
					<div class="item"><input name="brDate" readonly="readonly" class="easyui-textbox" data-options="label: '入院时间：', width: 200"></div>
					<div id="ckcf"  class="easyui-linkbutton" plain="true" iconCls="icon-ck">查看处方</div>
					<div id="ghcw"  class="easyui-linkbutton" plain="true" iconCls="icon-gh">更换床位</div>
				</form>
	</div>
		
			<!--选择床位-->
	<div id="his_ghcw" class="easyui-window" title="更换床位"  data-options="collapsible:false,minimizable:false,maximizable:false,modal:true,iconCls:'icon-xz',closed: true" 
				style="width:400px;height:350px;padding:0px;">
			<table id="tb-ghcw" class="easyui-datagrid" 
					data-options="
								  fitColumns:true,fit:true,
								  pagination: false,
								  pageSize: 5,
								  pageList: [5, 10, 15, 20],
								  rownumbers: false,
								  singleSelect:true,
								  toolbar: '#ghcwgjl'
			">
			<thead>
				<tr>
					<th data-options="field:'cwNo',width:'3%', checkbox: true">床位编号</th>
					<th data-options="field:'cwid',width:'35%'">床位号</th>
					<th data-options="field:'cwRent',width:'35%'">床位租金</th>
				</tr>
			</thead>
		</table>
		<div id="ghcwgjl">
		<a  id="ghcwqr" class="easyui-linkbutton" data-options="iconCls:'icon-qr',plain:true">确认</a>
		</div>
	</div>
		
		
		<div id="brcf" class="easyui-window" title="用药单"  data-options="collapsible:false,minimizable:false,maximizable:false,modal:true,iconCls:'icon-xz',closed: true" 
				style="width:200px;height:350px;padding:0px;">
			
			医嘱：<input name="" id="yizhu" >
			<hr/>
			<h3 align="center">病人药品单</h3>
			<div id="yaopin">
			
			</div>
			
	</div>
</body>
</html>